<?
/**
 * Webapp Login Form
 */
(basename($_SERVER['PHP_SELF']) == basename(__FILE__)) && die('Access Denied');

// Set title
$this->setTitle(WEB_APP_NAME . ' : Authentication Required');

// Are there errors?
$hasErrors = (is_array($this->getErrors()) and count($this->getErrors()));
?>
<?= $this->getPageHeader(); ?>
<div align="center">
<div id="page-container">
<div id="container-small">
<div id="menu-container-top">
	<?= $this->getTitle(); ?>
</div>

<div id="login-form-container">
<?= $this->getFormHeader('login_form'); ?>
<?= $this->getFormAction(ACTION_LOGIN); ?>
<table align="center">
<? if ($hasErrors) { ?>
	<tr>
		<td id="container-error" colspan="2">
			<?= implode('<br />', $this->getErrors()) . "\n"; ?>
		</td>
	</tr>
<? } ?>
	<tr>
		<th>Username:</th>
		<td>
			<INPUT type="text" name="<?= WA_QS_USERNAME; ?>" value="">
		</td>
	</tr>
	<tr>
		<th>Password:</th>
		<td>
			<INPUT type="password" name="<?= WA_QS_PASS1; ?>" value="">
		</td>
	</tr>
	<tr>
		<td colspan="2" style="text-align: right">
			<INPUT type="submit" name="submit" value="Authenticate">
		</td>
	</tr>
</table>
</form>
</div> <!-- login-form-container -->
</div> <!-- container-small -->
</div> <!-- page-container -->
</div> <!-- center -->

<script TYPE="text/javascript">
<!--
if (document.login_form.<?= WA_QS_USERNAME; ?>) {
	document.login_form.<?= WA_QS_USERNAME; ?>.focus();
	}
// -->
</script>
<?= $this->getPageFooter(); ?>
